package com.sap.jcp.sm.util;
public class Encrypt 
{
   private static String key = "jcpenney";
   public static String encryptString(String str)
   {
      StringBuffer sb = new StringBuffer (str);
      int lenStr = str.length();
      int lenKey = key.length();
      for ( int i = 0, j = 0; i < lenStr; i++, j++ ) 
      {
         if ( j >= lenKey ) j = 0;
         sb.setCharAt(i, (char)(str.charAt(i) ^ key.charAt(j))); 
      }
      return sb.toString();
   }
   
   public static String decryptString(String str)
   {
      return encryptString(str);
   }
}